<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <title>thehegeo.com</title>
    <link rel="stylesheet" href="StyleSheet.css" type="text/css" media="screen" />
    <script>
        window.onload = init;
        var vertx1 = [779, 887, 853, 741];
        var verty1 = [200, 201, 304, 301];

        var vertx2 = [902, 1011, 1043, 931];
        var verty2 = [200, 200, 306, 304];

        var vertx3 = [1048, 1084, 994, 959];
        var verty3 = [321, 423, 489, 385];

        var vertx4 = [980, 893, 805, 893];
        var verty4 = [498, 561, 500, 436];

        var vertx5 = [790, 701, 734, 825];
        var verty5 = [487, 423, 320, 385];

        var vertxen = [84,128,128,79];
        var vertyen = [731,731,774,774];
        
        var vertxvn = [135,135,188,188];
        var vertyvn = [733,776,776,733];

        function init() {
            if (window.Event) {
                document.captureEvents(Event.MOUSEMOVE);
            }
            document.onmousemove = getCursorXY;
            document.onmousedown = mouse_click;
        }

        function mouse_click(e) {
            var x = (window.Event) ? e.pageX : event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
            var y = (window.Event) ? e.pageY : event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
           // alert(x + '|' + y);
            if (pnpoly(4, vertx1, verty1, x, y)) {
                window.location.assign("eWhoWeAre.aspx");
            }
            else if (pnpoly(4, vertx2, verty2, x, y)) {
                window.location.assign("eWhoAreOurPartner.aspx");
            }
            else if (pnpoly(4, vertx3, verty3, x, y)) {
                window.location.assign("eWhatWeHave.aspx");
            }
            else if (pnpoly(4, vertx4, verty4, x, y)) {
                    
                window.location.assign("eContactUs.aspx");
            }
            else if (pnpoly(4, vertx5, verty5, x, y)) {
                window.location.assign("eWhatDoWeDo.aspx");
            }
            else if (pnpoly(4, vertxen, vertyen, x, y))
            {
                window.location.assign("index_en.html");
            }
            else if (pnpoly(4, vertxvn, vertyvn, x, y)) {

                window.location.assign("index.html");
            }
        }

        function getCursorXY(e) {
            var x = (window.Event) ? e.pageX : event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
            var y = (window.Event) ? e.pageY : event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);

           //alert(x +" | "+y);
            if (pnpoly(4, vertx1, verty1, x, y)) {
                document.getElementById('body_div').style.backgroundImage = "url('images/back_ground_1_en.png')";
            }
            else if (pnpoly(4, vertx2, verty2, x, y)) {
                document.getElementById('body_div').style.backgroundImage = "url('images/back_ground_2_en.png')";
            }
            else if (pnpoly(4, vertx3, verty3, x, y)) {
                document.getElementById('body_div').style.backgroundImage = "url('images/back_ground_3_en.png')";
            }
            else if (pnpoly(4, vertx4, verty4, x, y)) {
                document.getElementById('body_div').style.backgroundImage = "url('images/back_ground_4_en.png')";
            }
            else if (pnpoly(4, vertx5, verty5, x, y)) {
                document.getElementById('body_div').style.backgroundImage = "url('images/back_ground_5_en.png')";
            } else {
                document.getElementById('body_div').style.backgroundImage = "url('images/back_ground_en.png')";
            }
        }

        function pnpoly(nvert, vertx, verty, testx, testy) {
            var i, j, c = false;
            for (i = 0, j = nvert - 1; i < nvert; j = i++) {
                if (((verty[i] > testy) != (verty[j] > testy)) &&
                    (testx < (vertx[j] - vertx[i]) * (testy - verty[i]) / (verty[j] - verty[i]) + vertx[i])) {
                    c = !c;
                }
            }
            return c;
        }

    </script>
</head>
<body>
    <div id="back_body_div" class="back_body_en">
        <div id="body_div" class="div_body_en">
        </div>
    </div>
</body>
</html>
